<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<title>爱租网_找回密码</title>
	<link rel="icon" href="_img_/logo.ico"> 
	{css href="_css_/forget.css"}
	{css href="_js_/layui/css/layui.css"}
	{js href="_js_/jquery2.1.4.min.js"}
	{js href="_js_/layer/layer.js"}
	{js href="_js_/layui/layui.js"}
	{js href="_js_/jquery.validate.min.js"}
	{js href="_js_/additional-methods.js"}
	{js href="_js_/jquery.form.js"}
	{js href="_js_/messages_zh.js"}
</head>
<body>
	<div class="part1">
  </div>
		<a href="{:url('index/index/index')}"><img src="_img_/login1.png"></a>
		<span>.</span>
		<img src="_img_/login4.png">
	</div>
	<div style="height:30px"></div>
	<div class="part2">
		<form class="layui-form layui-col-xs5 layui-col-sm5 layui-col-md3 " action="{:url('index/login/forget')}" method="post">
			{if condition="$step==1"}
			<div clas="layui-input-item">
				<label class="title layui-form-label">手机号</label>
			</div>
			<div class="layui-form-item" style="height: 50px">
				<input class="layui-input" type="text" name="tel" autoconplete="off" placeholder="输入注册手机号" required remote="{:url('index/login/check2')}">
			</div>
			<div>
		 	<button class="layui-btn" type="submit" id="submit">获&nbsp;取&nbsp;验&nbsp;证&nbsp;码</button>
			 </div>
			{elseif condition="$step==2"}
			<div clas="layui-input-item">
				<label class="title layui-form-label">验证码</label>
			</div>
			<div class="layui-form-item" style="height: 50px">
				<input class="layui-input" type="text" name="code" autoconplete="off" placeholder="输入验证码" required>
			</div>
			<div>
		 	<button class="layui-btn" type="submit" id="submit">下&nbsp;一&nbsp;步</button>
			 </div>
			{elseif condition="$step==3"}
			<div clas="layui-input-item">
				<label class="title layui-form-label">修改密码</label>
			</div>
			<div class="layui-form-item"  style="height: 50px">
				<input class="layui-input" type="password" name="pwd" autoconplete="off" placeholder="密码" required rangelength=[6,16]>
			</div>
			<div class="layui-form-item"  style="height: 50px">
				<input class="layui-input" type="password" name="pwd_confirm" autoconplete="off" placeholder="再次确认密码" required rangelength=[6,16] equalto="input[name=pwd]">
			</div>
			<div>
		 	<button class="layui-btn" type="submit" id="submit">修&nbsp;改&nbsp;密&nbsp;码</button>
			</div>
			{/if}
		</form>
	</div>
	<div class="part3">
		©2017 Hangzhou ishangzu Technology Co.,Ltd. All rights reserved. 备案号：浙ICP备15007224号-2浙公网安备 33010802006107号
	</div>

<script type="text/javascript">
	$().ready(function(){
		if({$step} == 4){
			layer.msg('修改成功！',{icon:1,time:1000,offset: ['230px', '140px']},function(){
									location.href = '{:url('index/login/login')}'})
		}
		$('form').validate({
			rules:{
				tel:{
					isPhone:true,
				}
			},
			messages:{
				tel:{
					required:'请填写注册手机号',
					remote:'账号不存在'
				},
				code:{
					required:'请填写手机验证码',
					remote:'验证码错误'
				},
				pwd:{
					required:'请填写密码',
					rangelength:'密码为6-16位任意字符组合'
				},
				pwd_confirm:{
					required:'密码不能为空',
					rangelength:'密码为6-16位任意字符组合',
					equalTo:'密码输入不一致',
				},
			},
			
		});
	})
	

	layui.use('form', function(){
	  var form = layui.form;
	  form.render();
	});
</script>
</body>
</html>